// components/onlineComparison/onlineComparison.js
Component({

    /**
     * 组件的属性列表
     */
    properties: {
        onlineComparisonData: {
            type:Array
        },
        twoBooks: {
            type:Object
        },
        oneBooks: {
            type:Object
        },
        schoolReferenceNumber: {
            type: Number
        },
        aline: {
            type: String
        },
        bline: {
            type: String
        }
    },

    /**
     * 组件的初始数据
     */
    data: {
        menubar: 1,
        datainfo: {}
    },

    /**
     * 组件的方法列表
     */
    methods: {
        changeMenu(e) {
            if (e.currentTarget.dataset.id == 1) {
                this.setData({
                    datainfo: this.data.oneBooks
                })
            } else {
                this.setData({
                    datainfo: this.data.twoBooks
                })
            }
            this.setData({
                menubar: e.currentTarget.dataset.id
            })
        }
    },
    observers: {
        'oneBooks':function(n,o) {
            this.setData({
                datainfo: n,
                menubar:1
            })
            console.log(this.data.datainfo,'vvvvvvvvvvvvvvvvvvvvvvvv');
        },
    },
})